<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-ui-1.8.17.custom.min.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.multiselect.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.multiselect.filter.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.hoverIntent.minified.js"></script>
	<?php $cs=Yii::app()->clientScript;
$cs->scriptMap=array(
    'jquery.js'=>false,
);?>	
	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->
	
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery-ui-1.8.17.custom.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery.multiselect.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery.multiselect.filter.css" />

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<!-- Dropdown Starts -->
<script type="text/javascript">
$(document).ready(function() {
	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() {					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$(this).find(".row").each(function() {							   
				$(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			$(this).find(".sub").css({'width' :biggestRow});
			$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			$(this).calcSubWidth();
			//Set Width
			$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}


	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};

	$("ul#topnav li .sub").css({'opacity':'0'});
	$("ul#topnav li").hoverIntent(config);
});
</script>
    <!-- Dropdown Ends -->
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div id="page">

	<div id="header" class="heading_bg">
		<div id="logo"><a href="<?php echo Yii::app()->request->baseUrl;?>"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/youthconnect.png" alt="Youthconnect" title="Youthconnect" style="height: 82px;width: 200px;"/></a>
		<?php // echo CHtml::encode(Yii::app()->name); ?><br /><span class="username"></span></div>
	
<?php
	if (!Yii::app()->user->isGuest)
	{
	echo '<div class="login_wrapper">';	
	echo "<p>Welcome!<b>".Yii::app()->user->name."</b></p>";
 	echo CHtml::link(Yii::app()->getModule('admin')->t("Logout").' ',Yii::app()->getModule('admin')->logoutUrl, array('class'=>'logout')); 
	echo '</div>';	
	}
 ?>
	</div><!-- header -->
	
	
	<?php 
		$userManage = null;
		$profileManage = null;
		$restaurantTop= null;
		$emailTemplateTop=null;
		$staticpagesTop=null;
		$bannerDetailsTop=null;
		$reportTop = null;
		$accessTop = null;
		$ordersTop= null;
		$menusTop=null;
		$changePassword = null;
		$locationsTop=null;
		$customersTop=null;
		$dashboard=null;
		if(isset(Yii::app()->params['top']))
			{
				if(Yii::app()->params['top']=='dashboard')
					{
						$dashboard = 'class="selected"';
					}
				if(Yii::app()->params['top']=='userManage')
					{
						$userManage = 'class="selected"';
					}
				if(Yii::app()->params['top']=='profileManage')
					{
						$profileManage = 'class="selected"';
					}
				if(Yii::app()->params['top']=='vacationTop')
					{
						$vacationTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='restaurantTop')
					{
						$restaurantTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='emailTemplateTop')
					{
						$emailTemplateTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='staticPagesTop')
					{
						$staticpagesTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='bannerDetailsTop')
					{
						$bannerDetailsTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='locationsTop')
					{
						$locationsTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='customersTop')
					{
						$customersTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='ordersTop')
					{
						$ordersTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='menusTop')
					{
						$menusTop = 'class="selected"';
					}
				if(Yii::app()->params['top']=='reportsTop')
					{
						$reportTop = 'class="selected"';
					}					
				if(Yii::app()->params['top']=='accessTop')
					{
						$accessTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='changePassword')
					{
						$changePassword = array('class'=>'selected');
					}
			}
	
	?>
	<?php if(!Yii::app()->user->isGuest){?>
        <ul id="topnav">
         <li <?php echo $dashboard;?>><a href="<?php echo ApplicationConfig::getURL("admin", "cpanel", "index");?>">Home</a>
        </li >
        <li <?php echo $profileManage;?>><a href="<?php echo ApplicationConfig::getURL("admin", "profile", "profile");?>">My Profile</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                	<li><a href="<?php echo ApplicationConfig::getURL("admin", "profile", "edit");?>">Edit Profile</a></li>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "profile", "changepassword");?>">Change Password</a></li>
                </ul>
        </div>
        </li>
        <li <?php echo $userManage;?>><a href="#">User Management</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
               		<li><a href="<?php echo yii::app()->createUrl('admin/cpanel/manage')?>">Manage Users</a></li>
               		<li><a href="<?php echo yii::app()->createUrl('admin/role/managerole')?>">Manage Roles</a></li>
               		<li><a href="<?php echo yii::app()->createUrl('admin/permission')?>">Manage Permissions</a></li>
                </ul>
        </div>
        </li>

       <!--  <li <?php echo $restaurantTop;?>><a href="#">Restaurants</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
               		<li><a href="<?php echo yii::app()->createUrl('admin/restaurantManagement/index')?>">Restaurant List</a></li>
               		<li><a href="<?php echo yii::app()->createUrl('admin/restaurantManagement/create')?>">Create Restaurant</a></li>
                </ul>
        </div>
        </li> -->
        <li <?php echo $locationsTop;?>><a href="#">Locations</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
            		<li><a href="<?php echo yii::app()->createUrl('admin/state/index')?>">Manage States</a></li>
            		<li><a href="<?php echo yii::app()->createUrl('admin/city/index')?>">Manage Cities</a></li>
            		<!-- <li><a href="<?php echo yii::app()->createUrl('admin/suburb/index')?>">Manage Suburbs</a></li>
            		<li><a href="<?php echo yii::app()->createUrl('admin/zones/index')?>">Manage Zones</a></li> -->
                </ul>
        </div>
        </li>
        <li <?php echo $emailTemplateTop;?>><a href="<?php echo yii::app()->createUrl('admin/emailTemplate')?>">Email Templates</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
            		<li><a href="<?php echo yii::app()->createUrl('admin/emailTemplate/index')?>">Email Template List</a></li>
                    <li><a href="<?php echo yii::app()->createUrl('admin/emailTemplate/create')?>">Create Email Template</a></li>
                </ul>
        </div>
        </li>
        <li <?php echo $staticpagesTop;?>><a href="<?php echo yii::app()->createUrl('admin/staticPages')?>">Static Pages</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
            		<li><a href="<?php echo yii::app()->createUrl('admin/staticPages/index')?>">Static Pages List</a></li>
                    <li><a href="<?php echo yii::app()->createUrl('admin/staticPages/create')?>">Create Static Pages</a></li>
                </ul>    
        </div>
        </li>
        <li <?php echo $bannerDetailsTop;?>><a href="<?php echo yii::app()->createUrl('admin/bannerDetails')?>">Banner Management</a>
         <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                	<li><a href="<?php echo yii::app()->createUrl('admin/bannerDetails/index')?>">Banner Images</a></li>
                    <li><a href="<?php echo yii::app()->createUrl('admin/bannerVideos/index')?>">Banner Videos</a></li>
                </ul>
        </div>
        </li>
        <!-- <li <?php echo $customersTop;?>><a href="<?php echo yii::app()->createUrl('admin/customers')?>">Customers</a>
                <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "customers", "index");?>">Manage Customer</a></li>
                </ul>
       			</div>
        </li> -->
        <!-- <li <?php echo $ordersTop;?>><a href="<?php echo ApplicationConfig::getURL("admin", "orders", "index");?>">Order Management</a>
                 <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "orders", "index");?>">Manage Orders</a></li>
               <li><a href="<?php echo ApplicationConfig::getURL("admin", "orderStates", "index");?>">Manage Order States</a></li>
                </ul>
       			</div>
        </li>
         <li <?php echo $menusTop;?>><a href="#">Menu Management</a>
         	 <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "menuCategory", "index");?>">Manage Menu Categories</a></li>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "menuItem", "index");?>">Manage Menu Items</a></li>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "cuisine", "index");?>">Manage Cuisines</a></li>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "menuItemAttributes", "index");?>">Manage Attributes</a></li>
                </ul>
       		</div>
         </li>
        
          <li <?php echo $reportTop;?>><a href="<?php echo ApplicationConfig::getURL("admin", "reports", "index");?>">Reports</a>
         </li> -->
        </ul>
    <?php }?>
		<?php /*$this->widget('zii.widgets.CMenu',array(
			'id'=>'topnav',
			'items'=>array(
			array('url'=>array('/admin/profile/edit'), 'label'=>Yii::app()->getModule('admin')->t("My Profile"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$profileManage),
			array('url'=>array('/admin/cpanel'), 'label'=>Yii::app()->getModule('admin')->t("Manage User"), 'visible'=>AdminModule::isAdmin(),'itemOptions'=>$userManage),
			array('url'=>array('/admin/access'), 'label'=>Yii::app()->getModule('admin')->t("User Access"), 'visible'=>AdminModule::isAdmin(),'itemOptions'=>$accessTop),
			array('url'=>array('/admin/restaurantManagement'), 'label'=>Yii::app()->getModule('admin')->t("Restaurants"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$restaurantTop),
			array('url'=>array('/admin/locationManagement'), 'label'=>Yii::app()->getModule('admin')->t("Locations"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$locationsTop),
			array('url'=>array('/admin/emailTemplate'), 'label'=>Yii::app()->getModule('admin')->t("Email Templates"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$emailTemplateTop),
			array('url'=>array('/admin/staticPages'), 'label'=>Yii::app()->getModule('admin')->t("Static Pages"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$staticpagesTop),
			array('url'=>array('/admin/bannerDetails'), 'label'=>Yii::app()->getModule('admin')->t("Banner Management"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$bannerDetailsTop),
			array('url'=>array('/admin/customers'), 'label'=>Yii::app()->getModule('admin')->t("Customers"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$customersTop),			
			
			),
		));*/ ?>

	<?php /*if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'homeLink'=>CHtml::link('Home', Yii::app()->createUrl("admin/cpanel/manage")), 
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif*/ ?>
	
    <div class="container">

		<?php echo $content; ?>

    </div>

	<div id="footer">
		<!--Copyright &copy; <?php //echo date('Y'); ?>. <br/>
		Youthconnect.--><br/>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>